Skip to content

feat(issues): Implement EAP group search for issue feed queries#112985

Open
shashjar wants to merge 8 commits intoshashjar/make-organization-trace-item-stats-api-endpoint-generic-over-trace-item-typefrom
shashjar/issue-feed-search-eap-parse-search-filters-into-query-string
Open

feat(issues): Implement EAP group search for issue feed queries#112985
shashjar wants to merge 8 commits intoshashjar/make-organization-trace-item-stats-api-endpoint-generic-over-trace-item-typefrom
shashjar/issue-feed-search-eap-parse-search-filters-into-query-string

Conversation

@shashjar
Copy link
Copy Markdown
Member

@shashjar shashjar commented Apr 14, 2026

PR 1/2 to implement issue feed search via EAP queries. Precursor to #112996.

  • Adds search_filters_to_query_string() to convert legacy Snuba SearchFilter objects into EAP-compatible query strings
  • Adds run_eap_group_search() which provides issue feed search capability via EAP

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2026
@shashjar shashjar changed the title feat(occurrences on eap): Parse issue feed search filters into EAP query string feat(issues): Parse issue feed search filters into EAP query string Apr 14, 2026
)

WIP

PR 2 for implementing issue feed search with EAP queries
@shashjar shashjar changed the title feat(issues): Parse issue feed search filters into EAP query string feat(issues): Implement EAP group search for issue feed queries Apr 15, 2026
…t-generic-over-trace-item-type' into shashjar/issue-feed-search-eap-parse-search-filters-into-query-string
@shashjar shashjar marked this pull request as ready for review April 15, 2026 19:55
@shashjar shashjar requested review from a team as code owners April 15, 2026 19:55
@shashjar shashjar removed request for a team April 15, 2026 19:55
Comment thread src/sentry/search/eap/occurrences/search_executor.py
Comment thread src/sentry/search/eap/occurrences/search_executor.py
Comment thread src/sentry/search/eap/occurrences/search_executor.py
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 50f0c86. Configure here.

Comment thread src/sentry/search/eap/occurrences/search_executor.py Outdated
Comment on lines +177 to +178
if " " in s or '"' in s or "," in s or "(" in s or ")" in s:
escaped = s.replace("\\", "\\\\").replace('"', '\\"')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The _format_string_value function doesn't quote strings containing square brackets [ or ], which are special characters in EAP query syntax and may cause parsing errors.
Severity: MEDIUM

Suggested Fix

Update the conditional check in the _format_string_value function to include square brackets. Add checks for "[" in s and "]" in s to the if statement on line 177 to ensure strings containing these characters are properly quoted.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/search/eap/occurrences/search_executor.py#L177-L178

Potential issue: The `_format_string_value` function checks for special characters to
determine if a string value needs quoting, but it does not include square brackets (`[`
and `]`). Since square brackets are used for list syntax in EAP queries, a field value
containing them (e.g., `config[production]`) will not be quoted. This can cause the EAP
parser to misinterpret the literal string value as list syntax, potentially leading to
incorrect query behavior or parsing errors. The function already handles other
syntactically significant characters like parentheses and commas, suggesting the
omission of brackets is an oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant